package org.tio.sitexxx.im.common.MsgModel;

import org.tio.sitexxx.im.common.bs.Base;
import org.tio.sitexxx.service.model.main.Consultant;
import org.tio.sitexxx.service.model.main.ConsultantServiceStaff;
import org.tio.sitexxx.service.model.main.Member;

import java.util.HashMap;
import java.util.Map;

public class KFUser extends Base {
    private Integer i;//id
    private String a;//avatar
    private String n;//username  对应member表的name
    private String ln;//openid  模拟登陆tio的loginname

    public KFUser(){}

    public KFUser(Integer id,String username,String avatar,String openid){
        this.i = id;
        this.a = avatar;
        this.n = username;
        this.ln=openid;
    }

    public static KFUser fromConsultant(Consultant consultant){//来自顾问或者克服的消息
        KFUser user = new KFUser();
        user.setA(consultant.getAvata());
        user.setI(consultant.getId());
        user.setN(consultant.getName());
        user.setLn(consultant.getOpenid());
        return user;
    }
    public static KFUser fromMember(Member member){//来自用户的信息
        KFUser user = new KFUser();
        user.setA(member.getAvatar());
        user.setI(member.getId());
        user.setN(member.getName());
        user.setLn(member.getOpenid());
        return user;
    }

    public void setI(Integer i) {
        this.i = i;
    }

    public void setA(String a) {
        this.a = a;
    }

    public void setN(String n) {
        this.n = n;
    }

    public void setLn(String ln) {
        this.ln = ln;
    }

    public Integer getI() {
        return i;
    }

    public String getA() {
        return a;
    }

    public String getN() {
        return n;
    }

    public String getLn() {
        return ln;
    }
}
